<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Lw_string {
    protected $CI;
    public function __construct()
    {
        $this->CI =& get_instance();
    }

    function getstripslashes($str)
    {
        return get_magic_quotes_gpc() ? stripslashes($str) : $str;
    }

    /**
     * 生成唯一字符床
     * @return string
     */
    function getUniName(){
        return md5(uniqid(microtime(true),true));
    }

    /**
     * 得到文件的扩展名
     * @param string $fileName
     * @return string
     */
    function getExt($fileName){
        @$ext=strtolower(end(explode(".", $fileName)));
        return $ext;
    }
}